import './common.scss';

import { BuildComponents, ViewComponents, SettingComponents } from './components';
import FormDesign from './FormDesign';
import FormBuilder from './FormBuilder';
import FormView from './FormView';
import FormItem from './FormItem.vue';
import FormPreview from './FormPreview';
import FormDesignPreview from './FormDesignPreview';

const Form = {
  install(Vue) {
    
    let components = { ...BuildComponents, ...ViewComponents, ...SettingComponents }
    
    Object.keys(components).forEach(name => Vue.component(name, components[name]))
    
    Vue.component(FormDesign.name, FormDesign)
    Vue.component(FormBuilder.name, FormBuilder)
    Vue.component(FormView.name, FormView)
    Vue.component(FormItem.name, FormItem)
    Vue.component(FormPreview.name, FormPreview)
    Vue.component(FormDesignPreview.name, FormDesignPreview)
  }
};

export default Form;